package com.boc.ibatis.config;

import java.io.Reader;

import com.ibatis.common.resources.Resources;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;

public class IbatisSqlClient {
	public static final SqlMapClient sqlMapClient;
	static {
		try {
			String resource = "com/boc/ibatis/config/sqlMapConfig.xml";
			Reader reader = Resources.getResourceAsReader(resource);
			sqlMapClient = SqlMapClientBuilder.buildSqlMapClient(reader);
		} catch (Exception e) {
			e.printStackTrace();
			throw new RuntimeException(
					"Error initializing IbatorSqlConfig class. Cause: " + e);
		}
	}
}
